package com.bgs.engineering.util;

import com.bgs.engineering.api.sysUser.entiy.SysUser;
import org.springframework.security.core.context.SecurityContextHolder;


/**
 * @auther zcy
 * @data 2020/6/18 17:12
 */

public class UserUtils {


    /**
     *
     * 获取当前登录用户 放入缓存中
     * @return
     */
    public static SysUser getUser(){
        SysUser user = (SysUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return user;
    }

}
